﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;

namespace Sistema.Util.Interfaces
{
    public class ValidaXML
    {
       /* public bool Validar()
        {
            bool validou = true;
            String MensagemErro = String.Empty;

            XmlReaderSettings xmlSettings = new XmlReaderSettings();
            xmlSettings.ValidationType = ValidationType.Schema;

            XmlSchemaSet schemaCollection = new XmlSchemaSet();
            schemaCollection.Add(null, _schema);

            xmlSettings.Schemas.Add(schemaCollection);

            Action<object, ValidationEventArgs> ErroAoValidar = new Action<object, ValidationEventArgs>((Sender, EventArgs) =>
            {
                validou = false;
                MensagemErro += EventArgs.Message;
            });

            xmlSettings.ValidationEventHandler += new ValidationEventHandler(ErroAoValidar);
            Action<String> teste = new Action<string>(C => C.ToString());

            XmlReader reader = XmlReader.Create(Xml,xmlSettings);
            xmlSettings.Schemas.Schemas();
            while (reader.Read()) { }
        
            return false;

        }
        * */
    }
}
